<template>
  <!-- 标题 -->
  <div class="flex">
    <div class="blue-radius"></div>
    <h2 class="page-title">服务包管理</h2>
  </div>
  <el-form :inline="true" :model="formItem">
    <el-form-item label="服务包状态">
      <el-select v-model="formItem.region" placeholder="请选择" clearable style="width: 200px; height: 40px;">
        <el-option label="Zone one" value="shanghai" />
        <el-option label="Zone two" value="beijing" />
      </el-select>
    </el-form-item>
    <el-form-item>
      <el-input v-model.lazy="input.value" style="width: 376px;height: 40px; " size="large" placeholder="请输入关键字"
        :suffix-icon="Search" />
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="onServiceItem" class="add-items">新增服务包</el-button>
    </el-form-item>
  </el-form>
</template>

<script setup>
import { Search } from '@element-plus/icons-vue'
import { onMounted, ref, watch } from 'vue';
import { useRouter } from 'vue-router';
import { useFindData } from '../../composables/findData';
import { getServicePackageApi } from '../../api/servicePacksge';
const { servicePackageData, getServicePackageDataAsync, } = useFindData()
const router = useRouter()
const formItem = ref({
  region: ''
})
const input = ref({})
const onServiceItem = () => {
  router.push('/data/servicePack/add')
}
onMounted(() => {
  // searchData()
})
watch(input, () => {
  searchData()
})
const searchData = () => {
  getServicePackageDataAsync({
    ...input.value
  })
}
</script>

<style scoped lang="scss">
.add-items {
  margin-left: 282px;
}

.top-outer-layer {
  display: flex;
  height: 45px;
  margin-bottom: 10px;
}

.border-left {
  width: 6px;
  height: 24px;
  background-color: rgba(41, 132, 248, 1);
  border-radius: 10px;
}

.add-text {
  margin-left: 10px;
  font-size: 18px;
  color: rgba(51, 51, 51, 0.898039215686275);
}

.demo-form-inline {
  margin-bottom: 40px;
}

/* 修改 placeholder 颜色 */
::v-deep .el-input__inner::placeholder {
  color: #ccc;
  /* 浅灰色，可按需调整 */
}

.page-title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 550;
  color: #333333E5;
}

.blue-radius {
  border-width: 0px;
  width: 6px;
  height: 20px;
  background: inherit;
  background-color: rgba(41, 132, 248, 1);
  border: none;
  border-radius: 8px;
  -moz-box-shadow: none;
  -webkit-box-shadow: none;
  box-shadow: none;
  margin-top: 4px;
  margin-right: 10px;
}
</style>